import jsonp from '../common/js/jsonp'
import {commonParams,options} from "./config";
import axios from 'axios'

const debug = process.env.NODE_ENV !== 'production'


export function getRecommend() {
  const url = 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg'

  const data = Object.assign({},commonParams,{
    platform:'h5',
    uin:0,
    needNewCode:1
  });
  return jsonp(url,data,options)
}

//歌单推荐数据获取
export function getDiscList() {
  // const url = debug ? '/api/getDiscList' : 'http://ustbhuangyi.com/music/api/getDiscList'
  // const url = ' https://api.bzqll.com/music/tencent/hotSongList?key=579621905&categoryId=10000000&sortId=3&limit=60'
  const url = ' https://api.bzqll.com/music/tencent/hotSongList'
  const data = Object.assign({},commonParams,{
    key:579621905,
    categoryId: 10000000,
    sortId:3,
    limit:60
  });
  return jsonp(url,data,options)



//   const data = Object.assign({},commonParams,{
//     platform: 'yqq',
//     hostUin: 0,
//     sin: 0,
//     ein: 29,
//     sortId: 5,
//     needNewCode: 0,
//     categoryId: 10000000,
//     rnd: Math.random(),
//     format: 'json',
//   });
//   return axios.get(url,{
//     params:data
//   }).then((res) => {
//     return Promise.resolve(res.data)
//   })
}

